package com.ysd.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.dao.impl.NewsDao;
import com.ysd.entity.News;

/**
 * Servlet implementation class NewsServlet
 */
@WebServlet("/NewsServlet")
public class NewsServlet extends HttpServlet {
		NewsDao dao=new NewsDao();
		protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
			response.setContentType("text/html");
			response.setCharacterEncoding("utf-8");
			ArrayList<News> news=dao.getAll();
			request.setAttribute("News", news);
			request.getRequestDispatcher("article_list.jsp").include(request, response);
		}


}
